<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>统计</title>
    <link rel="shortcut icon" href="favicon.ico">
    <link href="../static/css/bootstrap.min.css" th:href="@{/css/bootstrap.min.css}" rel="stylesheet"/>
    <link href="../static/css/font-awesome.min.css" th:href="@{/css/font-awesome.min.css}" rel="stylesheet"/>
    <link href="../static/css/main/animate.min.css" th:href="@{/css/main/animate.min.css}" rel="stylesheet"/>
    <link href="../static/css/main/style.min862f.css" th:href="@{/css/main/style.min862f.css}" rel="stylesheet"/>
</head>

<body class="gray-bg">
    <div class="wrapper wrapper-content">
        <div class="row">
            <div class="col-sm-12">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>每日PK统计</h5>
                    </div>
                    <div class="ibox-content">
                        <div class="row">
                            <div class="col-md-12">
                                <div class="flot-chart" style="height:400px;">
                                    <div class="flot-chart-content" id="flot-dashboard-chart"></div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    <script th:src="@{/js/jquery.min.js}"></script>
    <script th:src="@{/js/bootstrap.min.js}"></script>
    <script th:src="@{/ajax/libs/flot/jquery.flot.js}"></script>
    <script th:src="@{/ajax/libs/report/echarts/echarts-all.js}"></script>
    <th:block th:include="include :: sparkline-js" />
    <script type="text/javascript" th:inline="javascript">
	    $(document).ready(function () {
	        
	        var myChart = echarts.init(document.getElementById('flot-dashboard-chart'));
	        // 指定图表的配置项和数据
	        option = {
			    title: {
			        text: '诗词PK统计'
			    },
			    tooltip: {
			        trigger: 'axis'
			    },
			    legend: {
			        data: ['参与人数', 'pk场次', '正常完成pk场次']
			    },
			    toolbox: {
			        feature: {
			            saveAsImage: {}
			        }
			    },
			    xAxis: {
			        type: 'category',
			        data: [[${dates}]]
			    },
			    yAxis: {
			        type: 'value'
			    },
			    series: [
			        {
			            name: '参与人数',
			            type: 'bar',
			            data: [[${userData}]]
			        },
			        {
			            name: 'pk场次',
			            type: 'bar',
			            data: [[${roomData}]]
			        },
			        {
			            name: '正常完成pk场次',
			            type: 'bar',
			            data: [[${finishData}]]
			        }
			    ]
			};


	        // 使用刚指定的配置项和数据显示图表。
	        myChart.setOption(option);
	    	
	    });
    </script>
</body>
</html>
